package com.grf.function.service;

import com.grf.function.function.CustomizeConsumer;
import com.grf.function.function.CustomizePredicate;
import com.grf.function.function.CustomizeSupplier;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @description: 特殊接口
 * @author: guorf
 * @date: 2024/8/21 00:02
 * @version: v1.0
 */
@Slf4j
@Service
public class SpecialService {

    /**
     * @description: 供应商
     * @author: grf
     * @date: 2024/8/22
     */
    public void supplier(CustomizeSupplier customizeSupplier){
        var ll = customizeSupplier.get();
        log.info("supplier : {}", ll);
    }
    /**
     * @description: 消费性
     * @author: grf
     * @date: 2024/8/22
     */
    public void consumer(CustomizeConsumer<String> consumer) {
        // StringBuilder sb = new StringBuilder("hello ");
        consumer.consumer("hello");
        // log.info("consumer is :{}", param);
    }
    /**
     * @description: 断定型
     * @author: grf
     * @date: 2024/8/22
     */
    public void predicat(CustomizePredicate predicate) {
        log.info("predicate result is {}", predicate.test("aaa"));
    }
}
